package com.easy;

/**
 * Created by Lxk on 2019/7/20.
 */
public class Solution191 {

    public int hammingWeight(int n) {
        int count = 0;
        while(n!=0){
            int res = n & 0x0000000000000001;
            if(res == 1){
                count++;
            }
            n = n>>1;
        }
        return count;
    }

    public static void main(String[] args) {
        Solution191 solution191 = new Solution191();
//        System.out.println(solution191.hammingWeight(11111111111111111111111111111101));
    }

}
